import { IPublicTypeComponentMetadata, IPublicTypeSnippet } from '@alilc/lowcode-types';

const CongestionLevelMeta: IPublicTypeComponentMetadata = {
  componentName: 'CongestionLevel',
  title: '拥堵等级',
  category: '监控',
  group: '通用组件',
  docUrl: '',
  screenshot: '',
  devMode: 'proCode',
  npm: {
    package: 'hzdz-charts',
    version: '0.1.0',
    exportName: 'CongestionLevel',
    main: 'src/index.tsx',
    destructuring: true,
    subName: ''
  },
  props: [
    {
      name: 'ref',
      propType: 'object',
    },
    {
      name: 'key',
      propType: 'string',
    },
    {
      name: 'style',
      propType: 'object',
    },
    {
      name: 'className',
      propType: 'string',
    },
    {
      name: 'width',
      propType: 'number',
      description: '组件宽度'
    },
    {
      name: 'height',
      propType: 'number',
      description: '组件高度'
    },
    {
      name: 'title',
      propType: 'string',
      description: '标题'
    },
    {
      name: 'titleColor',
      propType: 'string',
      description: '标题颜色'
    },
    {
      name: 'level',
      propType: 'object',
      description: '等级配置'
    },
    {
      name: 'levelBoxBackground',
      propType: 'string',
      description: '等级框背景'
    },
    {
      name: 'iconPath',
      propType: 'string',
      description: '图标路径'
    },
    {
      name: 'theme',
      propType: 'string',
      description: '主题'
    },
    {
      name: 'onClick',
      propType: 'func',
      description: '点击事件'
    }
  ],
  configure: {
    props: [
      {
        name: 'title',
        title: '标题',
        setter: 'StringSetter',
        defaultValue: '南北平台拥堵等级'
      },
      {
        name: 'titleColor',
        title: '标题颜色',
        setter: 'ColorSetter',
        defaultValue: 'rgba(255,255,255,0.9)'
      },
      {
        name: 'level.value',
        title: '等级数值',
        setter: 'StringSetter',
        defaultValue: '1.5'
      },
      {
        name: 'level.color',
        title: '数值颜色',
        setter: 'ColorSetter',
        defaultValue: '#FFFFFF'
      },
      {
        name: 'iconPath',
        title: '图标路径',
        setter: 'StringSetter',
        defaultValue: 'http://localhost:8085/static/images/chuxingfuwu/bj30.png'
      }
    ],
    supports: {
      style: true
    }
  }
};

const snippets: IPublicTypeSnippet[] = [
  {
    title: '拥堵等级',
    screenshot: '',
    schema: {
      componentName: 'CongestionLevel',
      props: {
        width: 175,
        height: 90,
        title: '南北平台拥堵等级',
        titleColor: 'rgba(255,255,255,0.9)',
        titleFontSize: 16,
        titleFontFamily: 'SourceHanSansSC',
        titleFontWeight: 400,
        titleLineHeight: '22px',
        level: {
          value: '1.5',
          fontSize: 24,
          color: '#FFFFFF',
          fontFamily: 'DINAlternate',
          fontWeight: 'bold',
          lineHeight: '28px',
          letterSpacing: '0.86px'
        },
        levelBoxBackground: 'http://localhost:8085/static/images/chuxingfuwu/jx2.png',
        levelBoxBorder: '1px solid #008BFF',
        iconPath: 'http://localhost:8085/static/images/chuxingfuwu/bj30.png',
        iconSize: {
          width: 24,
          height: 24
        },
        theme: 'dark'
      }
    }
  }
];

export default {
  ...CongestionLevelMeta,
  snippets
}; 